package com.siwei.mes.common.result;


import java.util.HashMap;

/**
 * @author chenmaolin
 * @date: 2021/12/28 10:53
 */
public class ApiResult extends HashMap<String, Object> {

    private static final long serialVersionUID = 1L;

    public static ApiResult addColumn(String key, Object value) {
        ApiResult result = new ApiResult();
        result.put(key, value);
        return result;
    }

    /**
     * 默认组装返回list数据
     *
     * @param value
     * @return
     */
    public static ApiResult addList(Object value) {
        ApiResult result = new ApiResult();
        result.put("list", value);
        return result;
    }

    /**
     * 默认组装返回id
     *
     * @param value
     * @return
     */
    public static ApiResult addId(Object value) {
        ApiResult result = new ApiResult();
        result.put("id", value);
        return result;
    }
}
